package com.yhos.platform.oopston.core.base;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("分页信息")
public class PageInfo {

    /**
     * 当前页码
     */
    @ApiModelProperty(value = "当前页码")
    private Integer pageIndex = 1;

    /**
     * 每页行数
     */
    @ApiModelProperty(value = "每页行数")
    private Integer pageSize = 20;

    /**
     * 总页数
     */
    @ApiModelProperty(value = "总页数")
    private Long totalPage = 0l;

    /**
     * 总行数
     */
    @ApiModelProperty(value = "总行数")
    private Long count = 0l;

    public PageInfo() {

    }

    public PageInfo(Page page) {
        this.pageIndex = page.getCurrent();
        this.pageSize = page.getSize();
        this.count = page.getTotal();
        this.totalPage = page.getPages();
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Long totalPage) {
        this.totalPage = totalPage;
    }

    public Long getCount() {
        return count;
    }

    public void setCount(Long count) {
        this.count = count;
    }
}
